# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Daniel Isenmann <daniel@archlinux.org>
# Contributor: Dominik Ryba <domryba@post.pl>

pkgname=enblend-enfuse
pkgver=4.2.r1524+h4c30a326b3f4
pkgrel=3
pkgdesc="Intelligent blend tool for overlapping picture"
arch=(loong64 x86_64)
url="http://enblend.sourceforge.net"
license=(GPL)
depends=(lcms2 vigra gsl exiv2)
makedepends=(mercurial libjpeg libpng libtiff openexr zlib help2man boost)
# The latest revision moves to C++17 instead of boost but requires exiv2 2.28 which is currently unreleased
#source=(enblend-enfuse::hg+http://hg.code.sf.net/p/enblend/code#revision=b236375ad1a8
source=(enblend-enfuse::hg+http://hg.code.sf.net/p/enblend/code#revision=4c30a326b3f4)
sha256sums=(SKIP)

pkgver() {
  cd ${pkgname}
  printf "4.2.r%s+h%s" "$(hg identify -n)" "$(hg identify -i)"
}

prepare() {
  cd ${pkgname}
  make --makefile=Makefile.scm
}

build() {
  cd ${pkgname}
  ./configure \
    --prefix=/usr \
    --enable-openmp=yes \
    --enable-opencl=yes \
    --with-exiv2 \
    --with-openexr
  make
}

package() {
  cd ${pkgname}
  make DESTDIR="${pkgdir}" install
}
